PATHMac OS 8 Developer Documentation > Operating System Services > Multiprocessing Services >

Adding Multitasking Capability to Applications Using Multiprocessing Services

   

Timer Duration Constants

Several Multiprocessing Services functions take a parameter of type Duration , which specifies the maximum time a task should wait for an event to occur. Multiprocessing Services recognizes four constants which you can use when specifying a duration. Note that you can use these constants in conjunction with other values to indicate specific wait intervals. For example, to wait 1 second, you can pass kDurationMillisecond * 1000 .

enum {
    kDurationImmediate      = 0L,
    kDurationForever        = 0x7FFFFFFF,
    kDurationMillisecond    = 1,
    kDurationMicrosecond    = -1
    };

Constant Descriptions

kDurationImmediate
The task times out immediately, whether or not the event has occurred. If the event occurred, the return status is noErr . If the event did not occur, the return status is kMPTimeoutErr (assuming no other errors occurred).
kDurationForever
The task waits forever. The blocking call waits until either the event occurs, or until the object being waited upon (such as a message queue) is deleted.
kDurationMillisecond
The task waits one millisecond before timing out.
kDurationMicrosecond
The task waits one microsecond before timing out.
VERSION NOTES

Introduced with Multiprocessing Services 2.0.


© 1999 Apple Computer, Inc. – (Last Updated 07 May 99)